<template>
    <header>
      <ul>
        <li><nuxt-link to="/">index页面</nuxt-link></li>
        <li><nuxt-link to="/about">about页面</nuxt-link></li>
        <li><nuxt-link to="/login">login页面</nuxt-link></li>
        <li><nuxt-link to="/home">home页面</nuxt-link></li>
      </ul>
    </header>
    <slot></slot>
    <footer>这是尾部内容</footer>
  </template>
  <script setup>
  useHead({
    title: "我的app",
    meta: [
      {
        name: "description",
        content: "我的",
      },
    ],
  });
  const config = useRuntimeConfig();
  // console.log(config, "count");
  // console.log(config.public.baseURL, "baseURL");
  console.log(add(11, 2));
  // console.log(request(11, 2));
  
  let input = ref("");
  
  // $fetch("http://localhost:3200/data").then((res) => { // 客户端和服务端都会执行
  //   console.log(res, "res1");
  // });
  // let res = useAsyncData('count',async  () => {    //useAsyncData的key值必须一致
  //   let r =  $fetch("http://localhost:3200/data");
  //   console.log('执行几次'); //只会在服务端的执行一次，客户端不执行
  //   return r
  // });
  //服务的渲染，refresh用于刷新token
  // let {refresh,status}= await useFetch('http://localhost:3200/data')
  // refresh()
  // console.log(refresh, status.value,"返回的数据");
  // let res = request("/data?name=zs", );
  // let res1 = request("/post",{method:'post',body:{name:'zs1'}} );
  // console.log(res1, "res");
  
  // if(import.meta.client){
  //   console.log(import.meta,'client');
  // }
  </script>
  <style lang="scss" scoped>
  h1 {
    color: $myColor;
  }
  </style>
  